﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chap11CardLib
{
    public class Cards : CollectionBase
    {
        public Card this[int index]
        {
            get { return (Card)List[index]; }
            set { List[index] = value; }
        }

        public void Add(Card card)
        {
            List.Add(card);
        }

        public bool Contains(Card card)
        {
            return InnerList.Contains(card);
        }

        public void Remove(Card card)
        {
            List.Remove(card);
        }

        public void CopyTo(Cards targetCards)
        {
            for (int i = 0; i < this.Count; i++)
            {
                targetCards[i] = this[i];
            }
        }   
    }
}
